<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class News extends MY_Controller
{

    public function __construct()
    {
        parent::__construct();
        $this->layout->setLayout('frontend/index');
    }

    public function index()
    {
        $data['news'] = $this->mnews->get_news();
        $this->layout->view('frontend/news', $data);
    }

    public function viewDetail($id){
        $data['news_detail'] = $this->mnews->getNewsById($id);
        $this->layout->view('frontend/news_detail', $data);
    }
}